package com.yunzhisec.event;


import java.io.Serializable;
import java.util.HashMap;

/***
 * 
 * 整个类的所有属性字段都是public修饰的，感觉get和set方法的意义存在不大
 * DDD 2020/08/27
 *
 */
public class EventObject implements Serializable {

	private static final long serialVersionUID = 711553217979572435L;
	
	public EventObject(){

	}
	
	/**
	 * 事件ID
	 */
	public long lid = 0;
	/**
	 * 事件归并数目
	 */
	public int imergecount=1;
	/**
	 * 事件名称
	 */
	public String ceventname="";
	/**
	 * 动作
	 */
	public String caction = "";
	/**
	 * 事件内容摘要
	 */
	public String ceventdigest="";
	/**
	 * 事件类型
	 */
	public String ceventtype="";
	/**
	 * 事件采集类型
	 */
	public int icollecttype;
	/**
	 * 事件等级
	 */
	public int ieventlevel=1;
	/**
	 * 网络协议
	 */
	public int iprotocol=-1;
	/**
	 * 网络应用协议
	 */
	public int iappprotocol=-1;
	/**
	 * 源名称
	 */
	public String csrcname="";
	/**
	 * 源MAC地址
	 */
	public String csrcmac="";
	/**
	 * 源IP地址
	 */
	public String csrcip="";
	/**
	 * 源转换IP地址
	 */
	public String csrctip="";
	/**
	 * 源端口
	 */
	public int isrcport;
	/**
	 * 源转换端口
	 */
	public int isrctport;
	/**
	 * 目的名称
	 */
	public String cdstname="";
	/**
	 * 目的MAC地址
	 */
	public String cdstmac="";
	/**
	 * 目的IP地址
	 */
	public String cdstip="";
	/**
	 * 目的转换IP地址
	 */
	public String cdsttip="";
	/**
	 * 目的端口
	 */
	public int idstport;
	/**
	 * 目的转换端口
	 */
	public int idsttport;
	/**
	 * 用户名称
	 */
	public String cusername="";
	/**
	 * 程序名称
	 */
	public String cprogram="";
	/**
	 * 操作
	 */
	public String coperation="";
	/**
	 * 对象
	 */
	public String cobject="";
	/**
	 * 结果
	 */
	public String cresult="";
	/**
	 * 响应
	 */
	public int ireponse=-1;
	/**
	 * 设备名称
	 */
	public String cdevname="";
	/**
	 * 设备类型
	 */
	public String cdevtype="";
	/**
	 * 设备IP地址
	 */
	public String cdevip="";
	/**
	 * 事件产生时间
	 */
	public long loccurtime;
	/**
	 * 事件接收时间
	 */
	public long lrecepttime;
	/**
	 * 采集器IP地址
	 */
	public String ccollectorip="";	
	/**
	 * 发送流量
	 */
	public long lsend;
	/**
	 * 接收流量
	 */
	public long lreceive;
	/**
	 * 持续时间
	 */
	public long lduration;
	/**
	 * 监控数值
	 */
	public double dmonitorvalue;
	/**
	 * 事件原始等级
	 */
	public String corilevel="";
	/**
	 * 事件原始类型
	 */
	public String coritype="";
	/**
	 * 请求内容
	 */
	public String crequestmsg="";
	/**
	 * 事件原始内容
	 */
	public String ceventmsg="";

	/**
	 * 解析该事件的范化名称
	 */
	public String csanalyse = "";

	/**
	 * 设备厂商
	 */
	public String cvendor="";
	/**
	 * 产品名称
	 */
	public String cproduct="";
   
	public HashMap<String,Object> eventfields = new HashMap<String,Object>();

	//事件类型 0.原始事件 1.关联事件
	public int logType = 0;
	
	public long getLid() {
		return lid;
	}
	public void setLid(long lid) {
		this.lid = lid;
	}
	public int getImergecount() {
		return imergecount;
	}
	public void setImergecount(int imergecount) {
		this.imergecount = imergecount;
	}
	public String getCeventname() {
		return ceventname;
	}
	public void setCeventname(String ceventname) {
		this.ceventname = ceventname;
	}
	public String getCeventdigest() {
		return ceventdigest;
	}
	public void setCeventdigest(String ceventdigest) {
		this.ceventdigest = ceventdigest;
	}
	public String getCeventtype() {
		return ceventtype;
	}
	public void setCeventtype(String ceventtype) {
		this.ceventtype = ceventtype;
	}
	public int getIcollecttype() {
		return icollecttype;
	}
	public void setIcollecttype(int icollecttype) {
		this.icollecttype = icollecttype;
	}
	public int getIeventlevel() {
		return ieventlevel;
	}
	public void setIeventlevel(int ieventlevel) {
		this.ieventlevel = ieventlevel;
	}
	public int getIprotocol() {
		return iprotocol;
	}
	public void setIprotocol(int iprotocol) {
		this.iprotocol = iprotocol;
	}
	public int getIappprotocol() {
		return iappprotocol;
	}
	public void setIappprotocol(int iappprotocol) {
		this.iappprotocol = iappprotocol;
	}
	public String getCsrcname() {
		return csrcname;
	}
	public void setCsrcname(String csrcname) {
		this.csrcname = csrcname;
	}
	public String getCsrcmac() {
		return csrcmac;
	}
	public void setCsrcmac(String csrcmac) {
		this.csrcmac = csrcmac;
	}
	public String getCsrcip() {
		return csrcip;
	}
	public void setCsrcip(String csrcip) {
		this.csrcip = csrcip;
	}
	public String getCsrctip() {
		return csrctip;
	}
	public void setCsrctip(String csrctip) {
		this.csrctip = csrctip;
	}
	public int getIsrcport() {
		return isrcport;
	}
	public void setIsrcport(int isrcport) {
		this.isrcport = isrcport;
	}
	public int getIsrctport() {
		return isrctport;
	}
	public void setIsrctport(int isrctport) {
		this.isrctport = isrctport;
	}
	public String getCdstname() {
		return cdstname;
	}
	public void setCdstname(String cdstname) {
		this.cdstname = cdstname;
	}
	public String getCdstmac() {
		return cdstmac;
	}
	public void setCdstmac(String cdstmac) {
		this.cdstmac = cdstmac;
	}
	public String getCdstip() {
		return cdstip;
	}
	public void setCdstip(String cdstip) {
		this.cdstip = cdstip;
	}
	public String getCdsttip() {
		return cdsttip;
	}
	public void setCdsttip(String cdsttip) {
		this.cdsttip = cdsttip;
	}
	public int getIdstport() {
		return idstport;
	}
	public void setIdstport(int idstport) {
		this.idstport = idstport;
	}
	public int getIdsttport() {
		return idsttport;
	}
	public void setIdsttport(int idsttport) {
		this.idsttport = idsttport;
	}
	public String getCusername() {
		return cusername;
	}
	public void setCusername(String cusername) {
		this.cusername = cusername;
	}
	public String getCprogram() {
		return cprogram;
	}
	public void setCprogram(String cprogram) {
		this.cprogram = cprogram;
	}
	public String getCoperation() {
		return coperation;
	}
	public void setCoperation(String coperation) {
		this.coperation = coperation;
	}
	public String getCobject() {
		return cobject;
	}
	public void setCobject(String cobject) {
		this.cobject = cobject;
	}
	public String getCresult() {
		return cresult;
	}
	public void setCresult(String cresult) {
		this.cresult = cresult;
	}
	public int getIreponse() {
		return ireponse;
	}
	public void setIreponse(int ireponse) {
		this.ireponse = ireponse;
	}
	public String getCdevname() {
		return cdevname;
	}
	public void setCdevname(String cdevname) {
		this.cdevname = cdevname;
	}
	public String getCdevtype() {
		return cdevtype;
	}
	public void setCdevtype(String cdevtype) {
		this.cdevtype = cdevtype;
	}
	public String getCdevip() {
		return cdevip;
	}
	public void setCdevip(String cdevip) {
		this.cdevip = cdevip;
	}
	public long getLoccurtime() {
		return loccurtime;
	}
	public void setLoccurtime(long loccurtime) {
		this.loccurtime = loccurtime;
	}
	public long getLrecepttime() {
		return lrecepttime;
	}
	public void setLrecepttime(long lrecepttime) {
		this.lrecepttime = lrecepttime;
	}
	public String getCcollectorip() {
		return ccollectorip;
	}
	public void setCcollectorip(String ccollectorip) {
		this.ccollectorip = ccollectorip;
	}
	public long getLsend() {
		return lsend;
	}
	public void setLsend(long lsend) {
		this.lsend = lsend;
	}
	public long getLreceive() {
		return lreceive;
	}
	public void setLreceive(long lreceive) {
		this.lreceive = lreceive;
	}
	public long getLduration() {
		return lduration;
	}
	public void setLduration(long lduration) {
		this.lduration = lduration;
	}
	public double getDmonitorvalue() {
		return dmonitorvalue;
	}
	public void setDmonitorvalue(double dmonitorvalue) {
		this.dmonitorvalue = dmonitorvalue;
	}
	public String getCorilevel() {
		return corilevel;
	}
	public void setCorilevel(String corilevel) {
		this.corilevel = corilevel;
	}
	public String getCoritype() {
		return coritype;
	}
	public void setCoritype(String coritype) {
		this.coritype = coritype;
	}
	public String getCrequestmsg() {
		return crequestmsg;
	}
	public void setCrequestmsg(String crequestmsg) {
		this.crequestmsg = crequestmsg;
	}
	public String getCeventmsg() {
		return ceventmsg;
	}
	public void setCeventmsg(String ceventmsg) {
		this.ceventmsg = ceventmsg;
	}

	public String getCaction() {
		return caction;
	}

	public void setCaction(String caction) {
		this.caction = caction;
	}

	public HashMap<String, Object> getEventfields() {
		return eventfields;
	}
	//处理自定义字段
	public void setEventField(String name, Object value)
	{
		eventfields.put(name, value);
	}
	
	public int getIntEventField(String name)
	{
		Object value=eventfields.get(name);
		if (value==null) {
            return 0;
        }
		return Integer.parseInt(String.valueOf(value));
	}
	
	public long getLongEventField(String name)
	{
		Object value=eventfields.get(name);
		if (value==null) {
            return 0;
        }
		return Long.parseLong(String.valueOf(value));
	}
	
	public String getStringEventField(String name)
	{
		Object value=eventfields.get(name);
		if (value==null) {
            return "";
        }
		return (String)value;
	}
	
	public double getDoubleEventField(String name)
	{
		Object value=eventfields.get(name);
		if (value==null) {
            return 0;
        }
		return Double.valueOf(String.valueOf(value));
	}

	public String getCvendor() {
		return cvendor;
	}

	public void setCvendor(String cvendor) {
		this.cvendor = cvendor;
	}

	public String getCproduct() {
		return cproduct;
	}

	public void setCproduct(String cproduct) {
		this.cproduct = cproduct;
	}

	public String getCsanalyse() {
		return csanalyse;
	}

	public void setCsanalyse(String csanalyse) {
		this.csanalyse = csanalyse;
	}

	public int getLogType() {
		return logType;
	}

	public void setLogType(int logType) {
		this.logType = logType;
	}
}
